package com.sumainfor.wx.tenant.controller.Feign;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.wx.tenant.service.impl.Feign.FeignTenantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 功能描述:
 *
 * @Auther: zhlu
 * @Date: 2019/5/18 10:52
 * @Description:
 */
@RestController
@RequestMapping("/key/FeTenant")
public class FeignTenantController {

    @Autowired
    FeignTenantService FeignTenantService;

    /**
     * 功能描述: 
     * 获取所有的租客编号
     * @Author zhlu
     * @Description //TODO
     * @Date 2019/5/18 10:54
     */
    @ResponseBody
    @GetMapping("/getTenantList")
    public JsonResult getTenantList(){
        JsonResult result=new JsonResult();
        return result.put(FeignTenantService.getTenantList());
    }


    /**
     * 根据手机号和租客姓名模糊查询
     * @author zhoucong
     * @data 2019/8/28
     * @Param
     * @return
     */
    @ResponseBody
    @GetMapping("/getTenIdPhone")
    public JsonResult getTenIdPhone(@RequestParam Map<String,Object> params){
        JsonResult result = new JsonResult();
        return result.put(FeignTenantService.getTenIdPhone(params));
    }

    /**
     * 根据手机号和租客姓名查询租客编号
     * @author zhoucong
     * @data 2019/8/28
     * @Param
     * @return
     */
    @ResponseBody
    @PostMapping("/getTenNameandPhone")
    public List<Map<String,Object>> getTenNameandPhone(@RequestBody Map<String,Object> params){

        return FeignTenantService.getTenNameandPhone(params);
    }


}
